<%@ page import="java.lang.management.ManagementFactory" %>
<%@ page import="java.lang.management.RuntimeMXBean" %>
<%@ page import="pers.lt.tools.StringFacs" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<html>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    request.setAttribute("basePath",basePath);
    //获取JVM的启动时间
    RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
    long startTime = bean.getStartTime();
    java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    java.util.Date Now = new java.util.Date(startTime);
    String  start_TIME = formatter.format(Now);
    request.setAttribute("startDate",start_TIME);
%>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />
    <jsp:include page="../../common/jsp/jqueryResource.jsp"></jsp:include>
    <link rel="stylesheet" href="${basePath}bootstrap/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="${basePath}bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${basePath}bootstrap/css/font-awesome.min.css" >
    <link rel="stylesheet" href="${basePath}bootstrap/bootstrap-datepicker/bootstrap.css">
    <link rel="stylesheet" href="${basePath}bootstrap/css/custom.min.css" >
    <link rel="stylesheet" href="${basePath}bootstrap/css/templatemo-style.css" >
    <link rel="stylesheet" href="${basePath}bootstrap/css/bootstrapValidator.css" >
    <link rel="stylesheet" href="${basePath}bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.min.css" >
    <script src="${basePath}bootstrap/js/bootstrap-table.min.js"></script>
    <script src="${basePath}bootstrap/js/bootstrap-datetimepicker.js"></script>
    <script src="${basePath}bootstrap/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="${basePath}bootstrap/js/bootstrap.min.js"></script>
    <script src="${basePath}javascript/import/import.js"></script>
    <script type="text/javascript" src="${basePath}bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

</head>
<style>
    input,button{
        display:inline-block!important;
    }
    .btn-success2{
        background: #48b2da;
        border: 1px solid #3192d0;
        color:#fff;
    }
    .btn-success3{
        background: #df5f4f;
        border: 1px solid #ca4b3b;
        color:#fff;
    }
    .loading {
        width: 160px;
        height: 56px;
        position: absolute;
        top: 50%;
        left: 50%;
        line-height: 56px;
        color: #fff;
        padding-left: 60px;
        font-size: 15px;
        background: #000 url(../../images/loding.gif) no-repeat 10px 50%;
        opacity: 0.7;
        z-index: 9999;
        -moz-border-radius: 20px;
        -webkit-border-radius: 20px;
        border-radius: 20px;
        filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70);
    }

</style>
<body>
<div class="templatemo-flex-row" style="height: 100%;">
    <div class="templatemo-sidebar">
        <header class="templatemo-site-header">
            <div class="square"></div>
            <h1> 数据平台</h1>
        </header>
        <div class="profile-photo-container">
            <img src="${basePath}/images/profile-photo.jpg" alt="Profile Photo" class="img-responsive">
            <div class="profile-photo-overlay"></div>
        </div>
        <div class="mobile-menu-icon">
            <i class="fa fa-bars"></i>
        </div>
        <nav class="templatemo-left-nav" id="navbar-nav">
            <ul>
                <li><a href="${basePath}in.html"><i class="fa fa-home fa-fw"></i>首页</a></li>
                <li><a href="${basePath}DRMB.xlsx"><i class="fa fa-paragraph fa-fw"></i>导入模板下载</a></li>
                <li><a href="${basePath}DRCXMB.xlsx"><i class="fa fa-bug"></i>查询模板下载</a></li>
                <li><a href="#"><i class="fa fa-bug"></i>统计查询</a></li>
            </ul>
        </nav>
    </div>
    <!-- Main content -->
    <div class="templatemo-content col-1 light-gray-bg">
       <div class="row" style="background: #fff;">
            <div class="col-md-1">
                <div class="templatemo-top-nav " >
                    <span style="padding-top:20px;padding-left:30px;display: block;color: #333;">首页</span>
                </div>
            </div>
            <div class="col-md-9">
                <div id="times_wrap" class="time_num" style="text-align:center;padding-top:10px;">
                    运行时间
                    <div class="time_w">
                        <span id="time_d" class="time"> </span >天
                        <span id="time_h" class="time"> </span >时
                        <span id="time_m" class="time"> </span >分
                        <span id="time_s" class="time"> </span >秒
                    </div>
                </div>
            </div>
            <div class="col-md-2">
                <nav>
                    <ul class="nav navbar-nav navbar-right">
                        <li class="">
                            <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                <img src="../images/img.jpg" alt="">欢迎${session_userinfo.displayname}
                                <span class=" fa fa-angle-down"></span>
                            </a>
                            <ul class="dropdown-menu dropdown-usermenu pull-right">
                                <li><a href="${basePath}login.html"> <h5><i class="fa fa-sign-out pull-right"></i> </h5> <h5>退出系统</h5></a></li>
                            </ul>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
        <div class="templatemo-content-container">
            <div class="container" style="padding-bottom:0px;">
                <div class="panel panel-default">
                    <div class="panel-heading">导入数据</div>
                    <div class="panel-body">
                        <form id="formSearch" class="form-horizontal">
                            <div class="row">
                                <div class="col-sm-">
                                    <form enctype="multipart/form-data" id="batchUpload"  action="import.html" method="post" class="form-horizontal">
                                        <button class="btn btn-success btn-xs" id="uploadEventBtn" style="height:26px;"  type="button" >选择文件</button>
                                        <input type="file" name="file"  style="width:0px;height:0px;" id="uploadEventFile">
                                        <input id="uploadEventPath"  disabled="disabled"  type="text" placeholder="请择excel表" style="border: 1px solid #e6e6e6; height: 26px;width: 200px;" />
                                    </form>
                                    <button type="button" class="btn btn-success btn-sm" style="width: 72px" onclick="user.uploadBtn()" >上传</button>
                                   <%-- <button type="button" class="btn btn-success btn-sm" style="width: 72px" id="" onclick="exportExcel()" >导出</button>--%>

                                </div>
                            </div>
                        </form>
                        <div class="row" style="float: right;">
                            <button type="button" class="btn btn-success2 btn-sm"  id="query" onclick="querydata()" >全部数据查询</button>
                            <button type="button" class="btn btn-success2 btn-sm"  id="" onclick="window.location.href='importlist.html'" >导入模板查询</button>
                        </div>
                    </div>
                </div>
            </div>
            <div id="toolbar" class="btn-group" >
                <button type="button" class="btn btn-success3 btn-sm" id="x" onclick="deleteAll()" style="margin-left: 10px">删除全部</button>
            </div>
            <table id="tb_import"></table>
        </div>
    </div>
</div>

<%--查询模态框--%>
<div  class="modal fade" id="detailModal" tabindex="-1"  role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog " style="width: 1000px;height: 500px" id="ss">
        <div class="modal-content">
            <div class="modal-header" style="background: #efefef">
                <button id="close" type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin-top: 9px">
                    &times;
                </button>
                <div class="panel-heading" style="background-color: #39ADB4;border-radius:10px 10px 0 0;border-color: #ddd;"><font color="white">数据展示</font></div>
                <div class="panel-body" style="border: 1px; border-radius:0 0 10px 10px;border-color: #ddd;background: white">
                管线号:<input type="text" style="border:1px solid #e6e6e6;background-color: #F0F0F0" id="line_No">&nbsp;&nbsp;&nbsp;焊缝号:<input type="text" style="border:1px solid #e6e6e6;background-color: #F0F0F0" id="Weld_No">
                &nbsp;&nbsp;&nbsp; <button type="button" class="btn btn-success btn-sm" id="cx"  style="margin-left: 10px;width: 72px">查询</button>
                &nbsp;&nbsp;&nbsp; <button type="button" class="btn btn-success btn-sm" id="dc"  style="width: 72px">导出</button>
                </div>
                <table id="query_data"></table>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<div class="container">
    <%--<div class="row">--%>
        <%--<button id="load" onclick="HtmlLoad()">加载页面</button>--%>
    <%--</div>--%>
    <div id="myModal" class="modal fade" data-keyboard="false"
         data-backdrop="static" data-role="dialog"
         aria-labelledby="myModalLabel" aria-hidden="true">
        <div id="loading" class="loading">数据导入中 。。。</div>
    </div>
</div>

</body>
</html>
<script type="text/javascript">
    var User = function() {
        this.init = function() {
            //模拟上传excel
            $("#uploadEventBtn").unbind("click").bind("click", function() {
                $("#uploadEventFile").click();
            });
            $("#uploadEventFile").bind("change", function() {
                $("#uploadEventPath").attr("value",    $("#uploadEventFile").val());
            });
        };
        //获取上传文件的大小
        function getFileSize(eleId) {
            try {
                var size = 0;
                size = $('#' + eleId)[0].files[0].size;//byte
                size = size / 1024;//kb
                size = size / 1024;//mb
                //alert('上传文件大小为' + size + 'M');
                return size;
            } catch (e) {
                alert("错误：" + e);
                return -1;
            }
        }
        //点击上传钮
        this.uploadBtn = function() {
            var uploadEventFile = $("#uploadEventFile").val();
            if (uploadEventFile == '') {
                alert("请择excel,再上传");
            } else if (uploadEventFile.lastIndexOf(".xls") < 0) {//可判断以.xls和.xlsx结尾的excel
                alert("只能上传Excel文件");
            } else if (getFileSize("uploadEventFile") > 0.4) {//允许在3000多条内
                alert("文件过大!")
            } else {
                debugger;
                var url = "import.html";
                var formData = new FormData($('form')[0]);
                user.sendAjaxRequest(url, "POST", formData);
            }
        };
        this.sendAjaxRequest = function(url, type, data) {
            HtmlLoad();
            $.ajax({
                url : url,
                type : type,
                data : data,
                dataType : "json",
                success : function(result) {
                    $('#myModal').modal('hide');
                    //重新加载table
                    $('#tb_import').bootstrapTable('destroy');
                    var ReTable = new TableInit();
                    ReTable.Init();
                    ReTable.hiddenColomn();
                },
                error : function(result) {
                    $('#myModal').modal('hide');
                    alert(result.message)
                    alert("出错了,请检查导入的数据模板!");
                },
                cache : false,
                contentType : false,
                processData : false
            });
        };
    };
    var user;
    $(function() {
        user = new User();
        user.init();
    })
    function exportExcel() {
        $.ajax({
            cache: true,
            type: "POST",
            data: "",
            url:encodeURI(g_BasePath+"export.html"),
            async: false,
            error: function (request) {
                alert("出错了！");
            },
            success: function (data) {
                //截掉下载地址里的引号
                var url=data.substring(1,data.length-1);
                /*  if (/(?:\"|\')/.test(data)) {
                 data = data.replaceAll("\"", "");
                 }*/
                window.open(g_BasePath + url);
                alert("导出成功");
            }
        });
    }
    //数据删除
    function del() {
        var rows = $('#tb_import').bootstrapTable('getSelections');

        //遍历所有选择的行数据，取每条数据对应的ID
        var ids = "";
        if (rows != null && rows.length > 0) {

            for (var i = 0; i < rows.length; i++) {
                if (i == 0) ids = rows[i].id;
                else ids += "~t" + rows[i].id;
            }
            var confirmdel= confirm('确认要删除吗?');
            if(confirmdel){
                $.ajax({
                    url: "${basePath}sjDelete.html?ids="+ids+"",
                    type: "POST",
                    dataType: 'json',
                    error: function (request) {
                        alert("删除成功！");
                        //重新加载table
                        $('#tb_import').bootstrapTable('destroy');
                        var ReTable = new TableInit();
                        ReTable.Init();
                        ReTable.hiddenColomn();
                    }
                });
                //重新加载table
                $('#tb_import').bootstrapTable('destroy');
                var ReTable = new TableInit();
                ReTable.Init();
                ReTable.hiddenColomn();
            }
        }else{
            alert("请先选择要删除的数据");
        }
    }
    function  deleteAll() {
        $.ajax({
            cache: true,
            type: "POST",
            data: "",
            url:encodeURI(g_BasePath+"deleteAll.html"),
            async: false,
            error: function (request) {
                alert("出错了！");
                //重新加载table
                $('#tb_import').bootstrapTable('destroy');
                var ReTable = new TableInit();
                ReTable.Init();
                ReTable.hiddenColomn();
            },
            success: function (data) {
                alert("删除成功");
                //重新加载table
                $('#tb_import').bootstrapTable('destroy');
                var ReTable = new TableInit();
                ReTable.Init();
                ReTable.hiddenColomn();
            }
        });
    }
    function querydata() {
        $("#line_No").val("");
        $("#Weld_No").val("");
        $('#query_data').bootstrapTable('destroy');
        $('#query_data').bootstrapTable({
            url: g_BasePath + "querts.html",
            method: 'get', //请求方式（*）
//            toolbar: '#toolbar', //工具按钮用哪个容器
            striped: true, //是否显示行间隔色
            cache: false, //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
            pagination: true, //是否显示分页（*）
            sortable: false, //是否启用排序
            sortOrder: "asc", //排序方式
            contentType : "application/x-www-form-urlencoded",
            queryParams: function (params) {
                var temp = { //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    rows: params.pageSize, //页面大小
                    page: params.pageNumber //页码
                };
                return temp;
            },
            sidePagination: "server", //分页方式：client客户端分页，server服务端分页（*）
            pageNumber: 1, //初始化加载第一页，默认第一页
            pageSize: 15, //每页的记录行数（*）
            pageList: [15, 20], //可供选择的每页的行数（*）
            search: false, //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
            strictSearch: true,
            showColumns: true, //是否显示所有的列
            showRefresh: true, //是否显示刷新按钮
            minimumCountColumns: 2, //最少允许的列数
            clickToSelect: true, //是否启用点击选中行
            //height: 440, //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
            uniqueId: "id", //每一行的唯一标识，一般为主键列
            showToggle: true, //是否显示详细视图和列表视图的切换按钮
            cardView: false, //是否显示详细视图
            detailView: false, //是否显示父子表
            //设置为undefined可以获取pageNumber，pageSize，searchText，sortName，sortOrder
            //设置为limit可以获取limit, offset, search, sort, order
            queryParamsType: "undefined",
            columns: [{
                checkbox: true,
                valign: "middle"
            },{
                align: "center",
                field: 'line_No',
                title: '管线号',
                valign: "middle"
            }, {
                align: "center",
                field: 'drawing_No',
                title: '线路号/图纸',
                valign: "middle",
            },{
                align: "center",
                field: 'weld_No',
                title: '焊缝号',
                valign: "middle"
            }, {
                align: "center",
                field: 'mk',
                title: 'MK',
                valign: "middle",
            }, {
                align: "center",
                field: 'welder_No',
                title: '焊工号',
                valign: "middle",
            }, {
                align: "center",
                field: 'pipe_size',
                title: '管线尺寸',
                valign: "middle"
            }, {
                align: "center",
                field: 'join_type',
                title: '焊接类型',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'cwp',
                title: '模块号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'cut',
                title: 'CUT',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'fab',
                title: 'fab号',
                valign: "middle",
            }, {
                align: "center",
                field: 'reason ',
                title: 'reason',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'check1',
                title: 'RT检测方式',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'check2',
                title: 'WMT检测方式',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'check3',
                title: 'HT检测方式',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'check4',
                title: 'PMI检测方式',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT检测比例',
                title: 'RT检测比例',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托来源',
                title: 'RT委托来源',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托单号',
                title: 'RT委托单号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托日期',
                title: 'RT委托日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告号',
                title: 'RT报告号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告上检测日期',
                title: 'RT报告上检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT现场实际检测日期',
                title: 'RT现场实际检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT出报告日期',
                title: 'RT出报告日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT缺陷',
                title: 'RT缺陷',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT评定结果',
                title: 'RT评定结果',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT每天报告焊口数',
                title: 'RT每天报告焊口数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT焊口点数',
                title: 'RT焊口点数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告递交情况',
                title: 'RT报告递交情况',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT备注',
                title: 'RT备注',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT检测比例',
                title: 'WMT检测比例',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT委托来源',
                title: 'WMT委托来源',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托单号',
                title: 'RT委托单号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT委托日期',
                title: 'WMT委托日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT报告号',
                title: 'WMT报告号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT报告上检测日期',
                title: 'WMT报告上检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT现场实际检测日期',
                title: 'WMT现场实际检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT出报告日期',
                title: 'WMT出报告日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT缺陷',
                title: 'WMT缺陷',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT评定结果',
                title: 'WMT评定结果',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT每天报告焊口数',
                title: 'WMT每天报告焊口数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT焊口点数',
                title: 'WMT焊口点数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT报告递交情况',
                title: 'WMT报告递交情况',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT备注',
                title: 'WMT备注',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'check4',
                title: 'PMI检测方式',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT检测比例',
                title: 'RT检测比例',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托来源',
                title: 'RT委托来源',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托单号',
                title: 'RT委托单号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托日期',
                title: 'RT委托日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告号',
                title: 'RT报告号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告上检测日期',
                title: 'RT报告上检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT现场实际检测日期',
                title: 'RT现场实际检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT出报告日期',
                title: 'RT出报告日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT缺陷',
                title: 'RT缺陷',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT评定结果',
                title: 'RT评定结果',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT每天报告焊口数',
                title: 'RT每天报告焊口数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT焊口点数',
                title: 'RT焊口点数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告递交情况',
                title: 'RT报告递交情况',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT备注',
                title: 'RT备注',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT检测比例',
                title: 'HT检测比例',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT委托来源',
                title: 'HT委托来源',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT委托单号',
                title: 'HT委托单号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT委托日期',
                title: 'HT委托日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT报告号',
                title: 'HT报告号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT报告上检测日期',
                title: 'HT报告上检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT现场实际检测日期',
                title: 'HT现场实际检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT出报告日期',
                title: 'HT出报告日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT缺陷',
                title: 'HT缺陷',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT评定结果',
                title: 'HT评定结果',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT每天报告焊口数',
                title: 'HT每天报告焊口数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT焊口点数',
                title: 'HT焊口点数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT报告递交情况',
                title: 'HT报告递交情况',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT备注',
                title: 'HT备注',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI检测比例',
                title: 'PMI检测比例',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI委托来源',
                title: 'PMI委托来源',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI委托单号',
                title: 'PMI委托单号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI委托日期',
                title: 'PMI委托日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI报告号',
                title: 'PMI报告号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI报告上检测日期',
                title: 'PMI报告上检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI现场实际检测日期',
                title: 'PMI现场实际检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI出报告日期',
                title: 'PMI出报告日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI缺陷',
                title: 'PMI缺陷',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI评定结果',
                title: 'PMI评定结果',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI每天报告焊口数',
                title: 'PMI每天报告焊口数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI焊口点数',
                title: 'PMI焊口点数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI报告递交情况',
                title: 'PMI报告递交情况',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI备注',
                title: 'PMI备注',
                valign: "middle",
                visible:false
            }
            ]
        });
        var w = document.documentElement.clientWidth*0.8 || document.body.clientWidth*0.8;
        var h = document.documentElement.clientHeight*0.6 || document.body.clientHeight*0.6;
        var obj = document.getElementById("ss");
        obj.style.cssText = "width:"+w+"px;height:"+h+"px;";
        $("#detailModal").modal("show");
    }
    $('#cx').bind('click', function () {
        var line_No = $("#line_No").val();
        var weldNo = $("#Weld_No").val();
        $("#query_data").bootstrapTable('destroy');
        $('#query_data').bootstrapTable({
          //  url: g_BasePath + "quertlist.html?drawingNo="+drawingNo+"&weldNo="+weldNo, //这个参数在这里传和在queryParams里一样，但是参数名要和实体类中的字段一样
            url: g_BasePath + "querts.html",
            method: 'get', //请求方式（*）
//            toolbar: '#toolbar', //工具按钮用哪个容器
            striped: true, //是否显示行间隔色
            cache: false, //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
            pagination: true, //是否显示分页（*）
            sortable: false, //是否启用排序
            sortOrder: "asc", //排序方式
            contentType : "application/x-www-form-urlencoded",
            queryParams: function (params) {
                var temp = { //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    rows: params.pageSize, //页面大小
                    page: params.pageNumber, //页码
                    lineNo:line_No,
                    weldNo:weldNo
                };
                return temp;
            },
            sidePagination: "server", //分页方式：client客户端分页，server服务端分页（*）
            pageNumber: 1, //初始化加载第一页，默认第一页
            pageSize: 15, //每页的记录行数（*）
            pageList: [15, 20], //可供选择的每页的行数（*）
            search: false, //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
            strictSearch: true,
            showColumns: true, //是否显示所有的列
            showRefresh: true, //是否显示刷新按钮
            minimumCountColumns: 2, //最少允许的列数
            clickToSelect: true, //是否启用点击选中行
            //height: 440, //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
            uniqueId: "id", //每一行的唯一标识，一般为主键列
            showToggle: true, //是否显示详细视图和列表视图的切换按钮
            cardView: false, //是否显示详细视图
            detailView: false, //是否显示父子表
            //设置为undefined可以获取pageNumber，pageSize，searchText，sortName，sortOrder
            //设置为limit可以获取limit, offset, search, sort, order
            queryParamsType: "undefined",
            columns: [{
                checkbox: true,
                valign: "middle"
            }, {
                //field: 'Number',//可不加
                align: "center",
                title: '序号',//标题  可不加
                formatter: function (value, row, index) {
                    return index + 1;
                }
            },{
                align: "center",
                field: 'line_No',
                title: '管线号',
                valign: "middle"
            }, {
                align: "center",
                field: 'drawing_No',
                title: '线路号/图纸',
                valign: "middle",
            },{
                align: "center",
                field: 'weld_No',
                title: '焊缝号',
                valign: "middle"
            }, {
                align: "center",
                field: 'mk',
                title: 'MK',
                valign: "middle",
            }, {
                align: "center",
                field: 'welder_No',
                title: '焊工号',
                valign: "middle",
            }, {
                align: "center",
                field: 'pipe_size',
                title: '管线尺寸',
                valign: "middle"
            }, {
                align: "center",
                field: 'join_type',
                title: '焊接类型',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'cwp',
                title: '模块号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'cut',
                title: 'CUT',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'fab',
                title: 'fab号',
                valign: "middle",
            }, {
                align: "center",
                field: 'reason ',
                title: 'reason',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'check1',
                title: 'RT检测方式',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'check2',
                title: 'WMT检测方式',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'check3',
                title: 'HT检测方式',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'check4',
                title: 'PMI检测方式',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT检测比例',
                title: 'RT检测比例',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托来源',
                title: 'RT委托来源',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托单号',
                title: 'RT委托单号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托日期',
                title: 'RT委托日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告号',
                title: 'RT报告号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告上检测日期',
                title: 'RT报告上检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT现场实际检测日期',
                title: 'RT现场实际检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT出报告日期',
                title: 'RT出报告日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT缺陷',
                title: 'RT缺陷',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT评定结果',
                title: 'RT评定结果',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT每天报告焊口数',
                title: 'RT每天报告焊口数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT焊口点数',
                title: 'RT焊口点数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告递交情况',
                title: 'RT报告递交情况',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT备注',
                title: 'RT备注',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT检测比例',
                title: 'WMT检测比例',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT委托来源',
                title: 'WMT委托来源',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托单号',
                title: 'RT委托单号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT委托日期',
                title: 'WMT委托日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT报告号',
                title: 'WMT报告号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT报告上检测日期',
                title: 'WMT报告上检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT现场实际检测日期',
                title: 'WMT现场实际检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT出报告日期',
                title: 'WMT出报告日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT缺陷',
                title: 'WMT缺陷',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT评定结果',
                title: 'WMT评定结果',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT每天报告焊口数',
                title: 'WMT每天报告焊口数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT焊口点数',
                title: 'WMT焊口点数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT报告递交情况',
                title: 'WMT报告递交情况',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'WMT备注',
                title: 'WMT备注',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'check4',
                title: 'PMI检测方式',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT检测比例',
                title: 'RT检测比例',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托来源',
                title: 'RT委托来源',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托单号',
                title: 'RT委托单号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT委托日期',
                title: 'RT委托日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告号',
                title: 'RT报告号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告上检测日期',
                title: 'RT报告上检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT现场实际检测日期',
                title: 'RT现场实际检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT出报告日期',
                title: 'RT出报告日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT缺陷',
                title: 'RT缺陷',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT评定结果',
                title: 'RT评定结果',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT每天报告焊口数',
                title: 'RT每天报告焊口数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT焊口点数',
                title: 'RT焊口点数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT报告递交情况',
                title: 'RT报告递交情况',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'RT备注',
                title: 'RT备注',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT检测比例',
                title: 'HT检测比例',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT委托来源',
                title: 'HT委托来源',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT委托单号',
                title: 'HT委托单号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT委托日期',
                title: 'HT委托日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT报告号',
                title: 'HT报告号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT报告上检测日期',
                title: 'HT报告上检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT现场实际检测日期',
                title: 'HT现场实际检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT出报告日期',
                title: 'HT出报告日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT缺陷',
                title: 'HT缺陷',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT评定结果',
                title: 'HT评定结果',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT每天报告焊口数',
                title: 'HT每天报告焊口数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT焊口点数',
                title: 'HT焊口点数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT报告递交情况',
                title: 'HT报告递交情况',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'HT备注',
                title: 'HT备注',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI检测比例',
                title: 'PMI检测比例',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI委托来源',
                title: 'PMI委托来源',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI委托单号',
                title: 'PMI委托单号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI委托日期',
                title: 'PMI委托日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI报告号',
                title: 'PMI报告号',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI报告上检测日期',
                title: 'PMI报告上检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI现场实际检测日期',
                title: 'PMI现场实际检测日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI出报告日期',
                title: 'PMI出报告日期',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI缺陷',
                title: 'PMI缺陷',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI评定结果',
                title: 'PMI评定结果',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI每天报告焊口数',
                title: 'PMI每天报告焊口数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI焊口点数',
                title: 'PMI焊口点数',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI报告递交情况',
                title: 'PMI报告递交情况',
                valign: "middle",
                visible:false
            }, {
                align: "center",
                field: 'PMI备注',
                title: 'PMI备注',
                valign: "middle",
                visible:false
            }
            ]
        });
    });

    //导出
    $('#dc').bind('click', function () {
        var line_No = $("#line_No").val();
        var weldNo = $("#Weld_No").val();
        $.ajax({
            cache: true,
            type: "POST",
            data: "",
            url:encodeURI(g_BasePath+"export.html?line_No="+line_No+"&weldNo="+weldNo+"&flag=1"),
            async: false,
            error: function (request) {
                alert("出错了！");
            },
            success: function (data) {
                //截掉下载地址里的引号
                var url=data.substring(1,data.length-1);
                /*  if (/(?:\"|\')/.test(data)) {
                 data = data.replaceAll("\"", "");
                 }*/
                window.open(g_BasePath + url);
                alert("导出成功");
            }
        });
    });
    $(function(){
        show_time();
    });
    function show_time(){
        var time_start = new Date("${startDate}").getTime();//设定开始时间(服务启动时间)
        var time_end = new Date().getTime(); //设定结束时间(等于系统当前时间)
        //计算时间差
        var time_distance = time_end - time_start;
        if(time_distance > 0){
            // 天时分秒换算
            var int_day = Math.floor(time_distance/86400000)
            time_distance -= int_day * 86400000;

            var int_hour = Math.floor(time_distance/3600000)
            time_distance -= int_hour * 3600000;

            var int_minute = Math.floor(time_distance/60000)
            time_distance -= int_minute * 60000;

            var int_second = Math.floor(time_distance/1000)
            // 时分秒为单数时、前面加零
            if(int_day < 10){
                int_day = "0" + int_day;
            }
            if(int_hour < 10){
                int_hour = "0" + int_hour;
            }
            if(int_minute < 10){
                int_minute = "0" + int_minute;
            }
            if(int_second < 10){
                int_second = "0" + int_second;
            }
            // 显示时间
            $("#time_d").html(int_day);
            $("#time_h").html(int_hour);
            $("#time_m").html(int_minute);
            $("#time_s").html(int_second);

            setTimeout("show_time()",1000);

        }else{
            $("#time_d").html('00');
            $("#time_h").html('00');
            $("#time_m").html('00');
            $("#time_s").html('00');

        }
    }
    function  HtmlLoad(url){
        $('#myModal').modal('show');

        // setTimeout(function () {
        //     $('#myModal').modal('hide');
        // }, 3000);

    }

</script>
<body>
</body>
